<div id="app-container" class="container" myapp="STORE_WECHAT_INFOS_EDIT">
  <%= hidden_field_tag :authenticity_token, form_authenticity_token, id: 'js-ruiqu-store-product-index' %>
  <div class="app">
     <div class="app-inner clearfix">
      <div class="widget-list-filter">
        <%= link_to "添加产品", new_ruiqu_product_category_product_path(@category), class: 'ui-btn ui-btn-success' %>
        <p class="help-block error-message flash-notice" style=""> <%= notice %></p>
      </div>
         <table id="wechat_table" class="ui-table ui-table-list">
          <thead>
              <tr>
                <th>
                  #
                </th>
                <th>
                  <%= "名字" %>
                </th>
                <th>
                  <%= "规格" %>
                </th>
                <th>
                  <%= "价格" %>
                </th>
                <th>
                  <%= "状态" %>
                </th>
                <th>
                  <%= "操作" %>
                </th>
              </tr>
          </thead>
          <tbody>
              <% @store_products.each_with_index do |product, i| %>
                <tr>
                  <td>
                    <%= i + 1 %>
                  </td>
                  <td>
                    <%= link_to product.name, ruiqu_store_product_path(product), class: "product-to-show" %>
                  </td>
                  <td>
                    <%= product.format %>
                  </td>
                  <td>
                    <%= product.price %>
                  </td>
                  <td class="js-showable">
                    <%= product.showable ? "前台显示" : "前台屏蔽" %>
                  </td>
                  <td>
                    <%= link_to '删除', unuse_ruiqu_product_category_product_path(product.store_product_category_id, product), method: :put, data: {confirm: "确认删除吗?"}%>

                    <%= link_to '编辑', edit_ruiqu_product_category_product_path(product.store_product_category_id, product) %>

                    <% if product.showable %>
                      <%= link_to '屏蔽显示', "#", class: "js-to-unshow-product", data: {id: product.id} %>
                    <% else %>
                      <%= link_to '开启显示', "#", class: "js-to-unshow-product", data: {id: product.id} %>
                    <% end %>
                  </td>
                </tr>
              <% end %>
          </tbody>
        </table>
      </div>
  </div>

</div>
